package com.orion.controller;

import com.orion.entity.Result;
import com.orion.enumeration.CommonCodeEnum;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @date 2021/11/3
 */
@RestController
@RequestMapping("/fallback")
public class FallbackController {

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/port")
    public Result fallback() {
        String data = "gateway hystrix fallback , port : " + port;
        return CommonCodeEnum.COMMON_SERVER_ERROR.toResult(data);
    }
}
